/****
 * 常 量
 *
 ****/
 
/** 局部页面的全局变量  */
var	 EMBED           = "";     // embed:  0:非嵌入式    1嵌入式  
var  MODEL_TYPES     = "";     // 运行模式  3:微信公众号 4:支付宝生活号 
var	 TERMINALID      = "";     // 设备号
var	 OPENID          = "";     // 用户openid
var	 DEALERNAME      = "";     // 网点名称
var	 TERMINALNAME    = "";     // 设备名称


var  PREPAYMENTTYPE  = "";     ////收费模式  
        
const FINDTYPES_TAKES   = "2";
const FINDTYPES_STORES  = "1";


/* 状态码 */
//const ERRCODE_NETWORKSTATE_OFFLINE  = "8002";
const ERRCODE_SUCCESS               = "0";
const ERRCODE_NO_STORERECOUNDS      = "-2";
const ERRCODE_ONECARDONEBOX         = "7105";

/* 设备网络状态 */
const NETWORKSTATE_ONLINE   		= "1";
const NETWORKSTATE_OFFLINE  		= "0";

/* 存取菜单显示FLAG*/
const SHOWTYPE_STORES      			= "stores";
const SHOWTYPE_TAKES        		= "takes";

/* 1:存开箱  2:取开箱 */
const OPENTYPE_STORE        		= "1";
const OPENTYPE_TAKE         		= "2";

/* 箱门状态0:成功  1:失败 */
const BOXSTATUS_SUCCESS     		= "0";
const BOXSTATUS_FAIL        		= "1";
const ERR_OTHER_EXCEPTION         		= "1024"; //其他处理异常
const ERR_OPENBOX_FAILED        		= "4097"; //远程开箱失败
const ERR_INSERTUSER_FAILED        		= "4101"; //推送用户失败
const ERR_BOXISUSERD_FAILED        		= "4105"; //箱门被占用
const ERR_ORDERISEMPTY_FAILED           = "4106";  //柜端找不到对应订单

/* 收费模式 0:免费 1:小时  2:天 */
const PREPAYMENT_FREE       		= "0";
const PREPAYMENT_HOUR       		= "1";
const PREPAYMENT_DAY        		= "2";

/* 开箱类型   1：非补交开箱   2：补交开箱 */
const OPENTYPE_UNMAKEUP     		= "1";
const OPENTYPE_MAKEUP       		= "2";

/* 开箱状态     0:表示成功   2:需要补交费用 */
const TAKEOPENBOXSTATUS_SUCCESS 	= "0";
const TAKEOPENBOXSTATUS_MAKEUP  	= "2";

/* 订单清楚流水号订单号传递类型 */
const FINDTYPES_TRADEWATERNO    	= "1";
const FINDTYPES_PACKAGEID       	= "2";

/* 失败类型   1:存开箱失败     2:取开箱失败(非补交)  3:取开箱失败(补交) */
const FAILTYPE_STORE 				= "1";
const FAILTYPE_TAKE_UNMAKEUP 		= "2";
const FAILTYPE_TAKE_MAKEUP	 		= "3";

/* 按钮类型   1:箱门已开(订单结束,同时记录异常) 2:箱门未开(记录异常) */
const BUTTONTYPE_OPENED 			= "1";
const BUTTONTYPE_CLOSED 			= "2";

/* 收费模式 0：免费  1：按小时 */
const PREPAYMENTTYPE_FREEMODAL  	= "0";
const PREPAYMENTTYPE_HOUR       	= "1";
const PREPAYMENTTYPE_DAY       	    = "2";

/* 结束订单FLAG */
const ENDORDER_STATE				= "1";

/* 一存多取退租FLAG*/
const TAKEFLAG_OPEN 				= "1";
const TAKEFLAG_SETTLEMENT 	  		= "2";

/* 一存多取退租FLAG*/
const ONE_OPEN_BOX 					= 1;
const ANY_OPEN_BOX 	  				= 2;

/**
 * 全局变量量
 * 
 **/

/* 基础属性 */
var BOXID;                                          // 箱号
var PREPAYMENTTYPE;                                 // 收费模式
var PACKAGEID;                                      // 订单编号
var USERANGE;                                       // 1: 结束订单(一存一取) 2：继续续租(一存多取) 3：兼容结束订单和继续续租(用户可选)
var STORELIST;                                      // 存LIST数据
var TAKELIST;                                       // 取LIST数据
var STORERNOECOUNDS = false;                        // 无存记录布尔标示
var TERMINALINFOMATION;     						// 设备信息（包含收费标准）
var MANAGERINFOMATION;      						// 管理员信息

var BOXTYPE_COUNTS_SUPERSMALL		= 0
var BOXTYPE_COUNTS_SMALL			= 0
var BOXTYPE_COUNTS_MEDIUM			= 0
var BOXTYPE_COUNTS_BIG				= 0
var BOXTYPE_COUNTS_SUPERBIG			= 0

/* 存支付全局变量 */
var STORECHARGE_BOXID;
var STORECHARGE_PREPAYMENT;
var STORECHARGE_TRADEWATERNO;
var STORECHARGE_PACKAGEID;

/* 取支付全局变量 */
var TAKECHARGE_BOXID;
var TAKECHARGE_PREPAYMENT;
var TAKECHARGE_TRADEWATERNO;
var TAKECHARGE_PACKAGEID;

/* 断网FLAG */
var OFFLINE = false;
var isStore = false;
/* 是否免费FLAG */
var isFree;
